<!--  -->
<template>
  <div class="searchbox">
    <searchbar :stype='csearchRoute'></searchbar>
  </div>
</template>

<script>
import searchbar from 'components/searchbar/Searchbar_box.vue'
  export default {
  data() {
    return {
      
    }
  },
  components:{
    searchbar
  },
  computed:{
    csearchRoute(){
      let CR = this.$store.state.currentRouting;
      return CR == ('/home' || 'category')? 'search' : this.$store.state.searchRoute.filter(arr => arr.path == CR)[0].box
    }
  },
  //生命周期 - 创建完成（访问当前this实例）
  methods:{
    mounted(){

    }
  },
  created() {
  
  },
  //生命周期 - 挂载完成（访问DOM元素）
  mounted() {
    
  }
  }
</script>
<style scoped>
/* @import url(); 引入css类 */
  @import url('~assets/css/base.css');
  .searchbox {
    position: sticky;
    top: 0px;
    height: 40px;
    background-color: #1177b0;
    box-shadow: 2px 0px 5px 0.5px #363636;
    z-index: 5;
  }
</style>